@charset "UTF-8";


/**************
 * Tree Views *
 **************/
treeview.view {
    -GtkTreeView-grid-line-width: 0;
    -GtkTreeView-grid-line-pattern: "";
    -GtkTreeView-tree-line-width: 1;
    -GtkTreeView-tree-line-pattern: "";
    -GtkTreeView-expander-size: 16;

    padding: 2px;
    border-left-color: gtk("@borders"); // this is actually the tree lines color,
    border-top-color: transparent; // while this is the grid lines color, better then nothing

    rubberband {
        @extend rubberband;
    } // to avoid borders being overridden by the previously set props

    &:hover {
        background-color: gtkalpha(gtk("@theme_widget_background_hover"), 0.6);
    }

    &:selected {
        border-radius: 0px;
        background-color: gtk("@theme_widget_background_checked");
    }

    &:backdrop {
        background-color: gtk("@theme_widget_background_backdrop");

        &:selected {
            background-color: gtk("@theme_widget_background_backdrop_checked");
        }

        &:disabled {
            background-color: gtk("@theme_widget_background_backdrop_insensitive");
        }
    }

    &:disabled {
        background-color: gtk("@theme_widget_background_insensitive");
    }

    &.separator {
        min-height: 2px;
        background-color: gtk("@theme_widget_background_normal");

        &:backdrop {
            background-color: gtk("@theme_widget_background_backdrop");
        }
    }

    &.expander {
        // GtkTreeView uses the larger of the expander’s min-width and min-height
        min-width: 16px;
        min-height: 16px;
        -gtk-icon-source: -gtk-icontheme($arrow_right);
        background-color: transparent;

        &:dir(rtl) {
            -gtk-icon-source: -gtk-icontheme("go-next-rtl-symbolic");
        }

        &:hover {
            background-color: gtk("@theme_widget_background_hover");
        }

        &:selected {
            border-radius: 0px;
            background-color: gtk("@theme_widget_background_checked");
        }

        &:checked {
            -gtk-icon-source: -gtk-icontheme($arrow_down);
        }

        &:backdrop {
            background-color: gtk("@theme_widget_background_backdrop");
        }
    }

    header {
        button {
            @extend %column_header_button;
            color: gtk("@theme_widget_foreground_normal");
            background-color: gtk("@theme_widget_background_normal");
            text-shadow: none;
            box-shadow: none;

            &:hover {
                @extend %column_header_button;
                background-color: gtk("@theme_widget_background_hover");
                box-shadow: none;
            }
            &:active {
                @extend %column_header_button;
                background-color: gtk("@theme_widget_background_active");
            }

            /* &:first-child {
                border-top-left-radius: $RadiusLittle;    
            }

            &:last-child {
                border-top-right-radius: $RadiusLittle;
            } */
        }

        button:last-child {
            &:backdrop,
            & {
                border-right-style: none;
            }
        }
    }

    button.dnd,
    header.button.dnd {
        // for treeview-like derive widgets
        &:active,
        &:selected,
        &:hover,
        & {
            padding: 0 6px;
            color: gtk("@theme_selected_fg_color");
            background-image: none;
            background-color: gtk("@theme_selected_bg_color");
            border-style: none;
            border-radius: 0;
            box-shadow: none;
            text-shadow: none;
        }
    }
}

%column_header_button {
    padding: 6px;
    border-style: none solid solid none;
    border-radius: 0;
    background-image: none;
    border-color: gtk("@theme_widget_border_normal");
    text-shadow: none;

    &:disabled {
        background-color: gtk("@theme_widget_background_insensitive");
        background-image: none;
    }

    &:backdrop {
        background-image: none;
        background-color: gtk("@theme_widget_background_backdrop");
        &:disabled {
            background-image: none;
            background-color: gtk("@theme_widget_background_backdrop_insensitive");
        }
    }
}
